package com.hcss.common.constant;

/**
 * @描述: 微信接口常量类
 * @作者: xuqian
 * @创建日期: 2018-07-13 9:40
 * @公司 浙江鸿程计算机系统有限公司
 */
public class WechatApiConstants {
    /**
     * OAuth2获取用户信息
     */
    public static final String OAUTH2_GETUSERINFO = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token=ACCESS_TOKEN&code=CODE";
    /**
     * OAuth2授权链接
     */
    public static final String OAUTH2_AUTHORIZE = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=snsapi_base&state=oAuth2#wechat_redirect";
    /**
     * 获取access_token
     */
    public static final String GET_TOKEN = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=ID&corpsecret=SECRECT";
    public static final String GETUSERINFO = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token=ACCESS_TOKEN&code=CODE";
    /**
     * 扫码登录
     */
    public static final String QRCODE = "https://open.work.weixin.qq.com/wwopen/sso/qrConnect?appid=APPID&agentid=AGENTID&redirect_uri=REDIRECT_URI";
    /**
     * 获取企业的jsapi_ticket
     */
    public static final String JSAPI_TICKET="https://qyapi.weixin.qq.com/cgi-bin/get_jsapi_ticket?access_token=ACCESS_TOKEN";
    /**
     * 获取应用的jsapi_ticket
     */
    public static final String JSAPI_TICKET_APP="https://qyapi.weixin.qq.com/cgi-bin/ticket/get?access_token=ACCESS_TOKEN&type=agent_config";

    public static class MetaLib {
        /**
         * 获取临时素材
         */
    	public static final String GET = "https://qyapi.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID";
    	
    }

    /**
     * 接口中需要替换的变量的占位字符串
     */
    public static class Placeholder {
        public static final String ID = "ID";
        public static final String APPID = "APPID";
        public static final String SECRECT = "SECRECT";
        public static final String ACCESS_TOKEN = "ACCESS_TOKEN";
        public static final String USERID = "USERID";
        public static final String AGENTID = "AGENTID";
        public static final String CODE = "CODE";
        public static final String REDIRECT_URI = "REDIRECT_URI";
        public static final String MEDIA_ID = "MEDIA_ID";
    }

    /**
     * 接口返回结果参数常量
     */
    public static class Result {
        /**
         * 返回码
         */
        public static final String ERRCODE = "errcode";
        /**
         * 对返回码的文本描述内容(英文)，可使用ErrorCodeText.errorMsg(errcode)进行转换为中文描述
         */
        public static final String ERRMSG = "errmsg";
        /**
         * 代表接口调用成功的标识
         */
        public static final int CODE_SECCESS = 0;
        /**
         * oauth2授权返回的用户code代码
         */
        public static final String USERID = "UserId";
    }
}
